package cn.xmy.demo01.service.impl;

import cn.xmy.demo01.dao.TrolleyDao;
import cn.xmy.demo01.pojo.Trolley;
import cn.xmy.demo01.service.TrolleyDaoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.SQLException;
import java.util.List;
@Service
public class TrolleyDaoImplService implements TrolleyDaoService {
    @Autowired
    TrolleyDao trolleyDao;
    @Override
    public int addTrolley(Trolley trolley) throws SQLException, ClassNotFoundException {
        int rows=trolleyDao.addTrolley(trolley);
        return rows;
    }

    @Override
    public List<Trolley> FindTrolley() throws SQLException, ClassNotFoundException {
        List<Trolley> list=trolleyDao.FindTrolley();
        return list;
    }

    @Override
    public List<Trolley> FindTrolleys(String id) throws SQLException, ClassNotFoundException {
        return trolleyDao.FindTrolleys(id);
    }

    @Override
    public List<Trolley> findAllTrolley() throws SQLException, ClassNotFoundException {
        return trolleyDao.findAllTrolley();
    }

    @Override
    public int updateShopQuantity(String id, int number, double total) {
        return trolleyDao.updateShopQuantity(id, number, total);
    }

    @Override
    public double getPriceById(String id) {
        return trolleyDao.getPriceById(id);
    }

    @Override
    public List<Trolley> findZhi1() throws SQLException, ClassNotFoundException {
        return trolleyDao.findZhi1();
    }

    @Override
    public List<Trolley> findZhi2() throws SQLException, ClassNotFoundException {
        return trolleyDao.findZhi2();
    }

    @Override
    public List<Trolley> findZhi3() throws SQLException, ClassNotFoundException {
        return trolleyDao.findZhi3();
    }

    @Override
    public List<Trolley> findZhi4() throws SQLException, ClassNotFoundException {
        return trolleyDao.findZhi4();
    }

    @Override
    public int updateZhiId(String id) throws SQLException, ClassNotFoundException {
        return trolleyDao.updateZhiId(id);
    }
}
